<section>
	<div>
		<ul class="breadcrumb">
			<li><a href="/view/index.html">Home</a></li>
			<li>Routes</li>
		</ul>
	</div>
	<div class="row">
		<div class="box col-md-12">
			<div class="panel panel-default">
				<div class="panel-heading">
					<div class="row">
						<div class="col-md-9" style="line-height: 30px;">
							<h4>
								<i class="glyphicon glyphicon-th"></i> Route List
							</h4>
						</div>
						<div class="col-md-3">
							<a class="btn btn-default" href="/view/route/create"> <i class="glyphicon glyphicon-edit icon-white"></i> Create API
							</a>
						</div>
					</div>
				</div>
				<div class="panel-body">
					<table class="table table-striped bootstrap-datatable datatable responsive dataTable">
						<thead>
							<tr>
								<th rowspan="1" colspan="1" style="width: 99px;">Gateway</th>
								<th rowspan="1" colspan="1" style="width: 99px;">Name</th>
								<th rowspan="1" colspan="1" style="width: 99px;">Path</th>
								<th rowspan="1" colspan="1" style="width: 99px;">Remark</th>
								<th rowspan="1" colspan="1" style="width: 99px;">Status</th>
								<th rowspan="1" colspan="1" style="width: 99px;">Actions</th>
							</tr>
						</thead>
						<tbody>
							<tr class="line">
								<td>${api.gateway}</td>
								<td><a href="/view/route/detail?apiId=${api.arId}">${api.name}</a></td>
								<td>${api.requestConfig.path}</td>
								<td>${api.remark}</td>
								<td>Closed</td>
								<td><a class="btn btn-default" href="/view/route/start?apiId=${api.arId}"><i class="glyphicon glyphicon-cog"></i><span> Start</span></a> <a class="btn btn-default" href="/view/route/update?apiId=${api.arId}"><i class="glyphicon glyphicon-pencil"></i><span>
											Update</span></a> <a class="btn btn-default" href="/view/route/delete?apiId=${api.arId}"><i class="glyphicon glyphicon-trash"></i><span> Delete</span></a></td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
</section>
<script type="text/javascript">
	$.ajax({
		type : 'GET',
		url : '/api/account/info',
		contentType : 'application/json',
		success : function(data) {
			if (data && data.code === 1 && data.result) {
				var username = data.result.username;
				var trhtml = '<tr class="line"><td>' + username
						+ '</td><td><a href="">' + username + '</a></td><td>'
						+ username + '</td><td>' + username + '</td>'
						+ username + '<td>' + username + '</td><td>' + username
						+ '</td></tr>';
				$('tbody').append(trhtml);
			}
		}
	});
</script>
